package workspace;

import java.util.Scanner;

public class test12 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] num = new int[n];
        for (int i = 0; i < n; i++) {
            num[i] = scanner.nextInt();
        }
        int res = 0;
        for (int i = 0; i < n-1; i++) {
            if(num[i]%2==0||num[i+1]%2==0){
                continue;
            }else{
                res++;
                num[i+1]++;
            }
        }
        System.out.println(res);
    }
}
